package com.kede.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kede.entity.Promote;
import com.kede.dao.PromoteDao;
import com.kede.service.PromoteService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 【请填写作者】
 * @since 2020-03-30
 */
@Service
public class PromoteServiceImpl extends ServiceImpl<PromoteDao, Promote> implements PromoteService {

    @Autowired
    PromoteDao promoteDao;

    @Override
    public Promote getByMid(long id) {
        QueryWrapper<Promote> Wrapper = new QueryWrapper<Promote>();
        Wrapper.eq("mid",id);
        Promote one=promoteDao.selectOne(Wrapper);
        return one;
    }

    @Override
    public boolean updatebp(Promote promote) {
       if (promoteDao.updateById(promote)>0){
           return true;
       }
        return false;
    }
}
